import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/home',
      component: () => import('../views/layout/layoutIndex.vue'),
      children: [
        {
          path: '/home',
          meta: {
            title: '首页'
          },
          component: () => import('../views/home/homeIndex.vue')
        },
        {
          path: '/message',
          meta: {
            title: '消息'
          },
          component: () => import('../views/message/msgIndex.vue')
        },
        {
          path: '/shop',
          meta: {
            title: '商城'
          },
          component: () => import('../views/shop/shopIndex.vue')
        },
        {
          path: '/case',
          meta: {
            title: '患者案例'
          },
          component: () => import('../views/case/caseIndex.vue')
        },
        {
          path: '/mine',
          meta: {
            title: '我的'
          },
          component: () => import('../views/mine/mineIndex.vue')
        },
        {
          path: '/detail',
          meta: {
            title: '详情'
          },
          component: () => import('../views/detail/index.vue')
        },
      ],
    
    },
    {
      path: '/more',
      name: '更多',
      component: () => import('../views/more/index.vue'),
    },
    {
      path: '/details/:id',
      name: '详情',
      component: () => import('../views/details/index.vue'),
    },
  ],
})

export default router
